//
//  YT_ComputerInvoker.swift
//  CommandPattern
//
//  Created by aron on 2017/6/4.
//  Copyright © 2017年 aron. All rights reserved.
//

import UIKit

class YT_ComputerInvoker: NSObject {
    
    private var startupCommand: YT_ComputerCommand?
    private var shutdownCommand: YT_ComputerCommand?
    
    init(startupCommand: YT_ComputerCommand, shutdownCommand: YT_ComputerCommand) {
        self.startupCommand = startupCommand
        self.shutdownCommand = shutdownCommand
    }
    
    func startup() {
        self.startupCommand?.execute()
    }
    
    func shutdown() {
        self.shutdownCommand?.execute()
    }
}
